import { connect } from "dva"
import StudentTable from "../StudentTable"

const matStateToProps = state => ({
    stus: state.students.result.datas,
    current: state.students.condition.page,
    total: state.students.result.total,
    panelNumber: 5,
    showQuickJumper: true,
    loading: state.loading.effects["students/fetchStudents"]
})

const mapDispatchToProps = dispatch => ({
    onChange(newPage) {
        dispatch({
            type: "students/setCondition",
            payload: {
                page: newPage
            }
        })
    }
})


export default connect(matStateToProps, mapDispatchToProps)(StudentTable)